﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace YJ_App.Tool.Image
{
    /// <summary>
    /// 上传图片Dto
    /// </summary>
    public class ImageDto
    {
        /// <summary>
        /// 输入模型
        /// </summary>
        public class UploadImageInput
        {
            public IFormFile Files { get; set; }
            public string Type { get; set; }
        }

        // Imgbb响应模型
        public class ImgBBResponse
        {
            public UploadImageResponse data { get; set; }
            public bool success { get; set; }
            public int status { get; set; }
        }

        // 定义明确的返回类型
        public class UploadImageResponse
        {

            public string? url { get; set; }
        }

        /// <summary>
        /// 1. 新增 SM.MS 响应模型（适配其 API 返回格式）
        /// </summary>
        public class SmMsResponse
        {
            public bool Success { get; set; }
            public string Message { get; set; }
            public SmMsData Data { get; set; }
        }

        public class SmMsData
        {
            public string Url { get; set; } // 国内访问链接
            public string Delete { get; set; } // 删除链接（可选存储）
        }

        /// <summary>
        /// ImageDto.cs 或新建 OssOptions.cs
        /// </summary>
        public class OssOptions
        {
            public string Endpoint { get; set; }
            public string AccessKeyId { get; set; }
            public string AccessKeySecret { get; set; }
            public string BucketName { get; set; }
            public string Domain { get; set; } // 自定义域名（可选）
        }

        // OSS 上传响应模型
        public class OssUploadResponse
        {
            public bool success { get; set; }
            public string url { get; set; }
            public string objectKey { get; set; }
            public string message { get; set; }
        }
    }
}
